package com.zhsq.zlc.dao.authority;

import com.zhsq.zlc.entity.AuthorityEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
@Component
@Mapper
public interface AuthorityMapper {
	
	List<AuthorityEntity> list(AuthorityEntity entity) throws Exception;

	int count(AuthorityEntity entity) throws Exception;

	List<AuthorityEntity> getAuthorityById(AuthorityEntity entity) throws Exception;

	void add(AuthorityEntity entity) throws Exception;
	
	void edit(AuthorityEntity entity) throws Exception;
	
	void delete(int id) throws Exception;
	
	List<AuthorityEntity> getAuthorityTree() throws Exception;

	List<AuthorityEntity> getParentAuthorityById(Integer roleId) throws Exception;
	
	List<AuthorityEntity> getAuthoritysByParentId(Integer parentId) throws Exception;
	
	List<AuthorityEntity> getAuthorityByRoleId(Integer roleId) throws Exception;

	void delAuthorityByRole(Integer roleId) throws Exception;

	void batchInsertRoleAuthortity(List<Map<String, Object>> param);
	
}
